
#include "hal_isr.h"
#include "jxos_public.h"

void jxos_prepare_to_run_callback_handler(void);

void sys_power_mgr_task_hal_init_callback_handler(void);
void sys_power_mgr_task_prepare_to_sleep_callback_handler(void);
void sys_power_mgr_task_go_to_sleep_callback_handler(void);
void sys_power_mgr_task_recover_to_wake_callback_handler(void);

void sys_debug_print_task_hal_init_callback_handler(void);
uint8_t sys_debug_print_task_send_finish_check_callback_handler(void);
void sys_debug_print_task_send_byte_callback_handler(uint8_t byte);

void sys_software_timer_task_hal_init_callback_handler(void);
void sys_software_timer_task_hal_start_callback_handler(void);
void sys_software_timer_task_hal_stop_callback_handler(void);
//uint16_t sys_software_timer_task_hal_set_next_interrupt_time_in_ms_callback_handler(uint16_t next_interrupt_time_in_ms);

void std_app_key_task_hal_init_callback_handler(void);
uint8_t std_app_key_task_hal_read_pin_level_callback_handler(uint8_t key_mun);

void jxos_user_init_callback(void)
{
	jxos_prepare_to_run_callback = jxos_prepare_to_run_callback_handler;
	
#if	(JXOS_SYS_SERVICE_POWER_MGR_TASK_ENABLE == 1)
	sys_power_mgr_task_hal_init_callback = sys_power_mgr_task_hal_init_callback_handler;
	sys_power_mgr_task_prepare_to_sleep_callback = sys_power_mgr_task_prepare_to_sleep_callback_handler;
	sys_power_mgr_task_go_to_sleep_callback = sys_power_mgr_task_go_to_sleep_callback_handler;
	sys_power_mgr_task_recover_to_wake_callback = sys_power_mgr_task_recover_to_wake_callback_handler;
#endif
	
#if	(JXOS_SYS_SERVICE_DEBUG_PRINT_TASK_ENABLE == 1)
	sys_debug_print_task_hal_init_callback = sys_debug_print_task_hal_init_callback_handler;
	sys_debug_print_task_send_finish_check_callback = sys_debug_print_task_send_finish_check_callback_handler;
	sys_debug_print_task_send_byte_callback = sys_debug_print_task_send_byte_callback_handler;
#endif
	
#if	(JXOS_SYS_SERVICE_SOFTWARE_TIMER_TASK_ENABLE == 1)
	sys_svc_software_timer_init_callback = sys_software_timer_task_hal_init_callback_handler;
	sys_software_timer_task_hal_start_callback = sys_software_timer_task_hal_start_callback_handler;
	sys_software_timer_task_hal_stop_callback = sys_software_timer_task_hal_stop_callback_handler;
//	sys_software_timer_task_hal_set_next_interrupt_time_in_ms_callback = sys_software_timer_task_hal_set_next_interrupt_time_in_ms_callback_handler;
#endif

#if	(JXOS_STD_APP_KEY_TASK_ENABLE == 1)
	std_app_key_task_hal_init_callback = std_app_key_task_hal_init_callback_handler;
	std_app_key_task_hal_read_pin_level_callback = std_app_key_task_hal_read_pin_level_callback_handler;
#endif
}

void ir_rx_task_init(void);
void ir_tx_task_init(void);
void jxos_user_task_init_callback(void)
{
	ir_rx_task_init();
	ir_tx_task_init();
}
